/**
 * My simple header template from child directory
 * Calculator.java - ${projectName} - ${organizationName} - ${inceptionYear}
 */
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: Gauss
 * Date: 02.03.14
 * Time: 23:50
 * To change this template use File | Settings | File Templates.
 */
public class Calculator {

    private long time;
    private long fileSize;
    private FileSizeCalculator calculator;

    public Calculator(FileSizeCalculator calculator) {
        this.calculator = calculator;
    }

    public long getTime() {
        return time;
    }

    public long calculate(String fileName) throws IOException {
        time = System.nanoTime();
        fileSize = calculator.calculateSize(fileName);
        time = System.nanoTime() - time;
        return fileSize;
    }

}
